package classify

import "gitee.com/thubcc/p2pgit/types"

type tempclassify struct{ drop bool }

func (t tempclassify) Hit(types.Hash) bool {
	return !t.drop
}

func (tempclassify) String() string {
	return "temp"
}

func (tempclassify) IdxKey(h types.Hash) (kp [4]byte) {
	copy(kp[:], h[:4])
	return
}

func (t tempclassify) Drop() {
	t.drop = true
	return
}

func (t tempclassify) Reset() {
	t.drop = false
	return
}

// TempClassifier a nil classifier
var TempClassifier tempclassify
